<@override name="head">
<title>订单管理</title>
<script type="text/javascript" src="${ctx}/assets/js/lib/bootstrap.min.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/lib/bootbox.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/common/table.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/common/dropDownList.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/advertiser/order.js"></script>
</@override> 
<@override name="body">
<div id=content_bg>
<#include "/main/home/common.ftl"/>
    <div id="pagecontent">
        <div id="content">
            <div id="navDiv">
                <ul id="navDiv_ul">
                    <li><i class="icon-home"></i></li>
                    <li><a href="${ctx}/advertiser/main/dashboard">首页</a></li>
                    <li><i class="icon-angle-right"></i></li>
                    <#if role == "agent">
                    <li><a href="${ctx}/advertiser/main/ad/advertiser/list">广告主管理</a></li>
                    <li><i class="icon-angle-right"></i></li>
                    </#if>
                    <li class="navDiv_currentLi">订单管理</li>
                </ul>  
            </div>
            <form id="myform" action="${ctx}/advertiser/main/ad/order/list?advertiserId=${advertiserId!}" method="post">
                <input type="hidden" id="status" name="status" value="${status!}"/>
                <div id="selectuls">
                    <ul id="main_advertiserul" class="son_selectul">
                        <li class="select_box" id="advertiserul_box">
                            <span id="advertiserul_span">${selectedadvertiserName!}</span>
                            <ul class="son_ul" id="advertiser_son_ul"></ul>
                        </li>
                    </ul>
                    <input type="hidden" name="advertiserId" id="advertiserId" value="${advertiserId!}"/>
                    <input type="hidden" name="selectedadvertiserName" id="advertiserName" value="${selectedadvertiserName!}"/>
                </div>
                <div id="selectBar_status" class="selectBar">
                    <span>状态：</span>
                    <a value="2">全部</a>
                    <a value="0">正常</a>
                    <a value="1">停用</a>
                </div>
                <div id="navButtons_other">
                    <div id="button">                   
                        <a href="${ctx}/advertiser/main/ad/order/create?advertiserId=${advertiserId!}" class="btn2" id="btn-create">创建订单</a>
                        <a class="btn2" id="all-btn-enable">批量开启</a>
                        <a class="btn2" id="all-btn-disable">批量暂停</a>
                        <a class="btn2" id="all-btn-delete">批量删除</a>
                    </div>
                    <div id="searchValueDiv">
                        <input type="hidden" id="page" name="page" value="${pager.page}"/>
                        <input id="searchValue" type="text" name="searchValue" value="${searchValue!}" tabindex="1" placeholder="请输入订单名称"/>
                        <input id="serachData_img" type="submit" value=""/>
                    </div>
                </div>
                <table border="1" class="tableFig" style="table-layout:fixed;">
                    <thead>
                        <tr class="theadTr">
                            <th class="theadTh" style="width:5%;"><div class="checkboxStyleTh"></div></th>
                            <th class="theadTh" style="width:5%;">ID</th>
                            <th class="theadTh" style="width:10%;">订单名称</th>
                            <th class="theadTh" style="width:5%;">总预算</th>
                            <th class="theadTh" style="width:15%;">所属人</th>
                            <th class="theadTh" style="width:15%;">最后更新日期</th>
                            <th class="theadTh" style="width:5%;">状态</th>
                            <th class="theadTh" style="width:25%;">操作</th>
                        </tr> 
                    </thead>
                    <tbody>
                        <#if orderList ??>
                        <#list orderList as order>
                            <tr id="tbodyTr">
                                <td class="tbodyTd"><div class="checkboxStyleTd" id="${order.id!}"></div></td>
                                <td class="tbodyTd">${order.id!}</td>
                                    <td class="tbodyTd" style="word-wrap:break-word;">
                                    <a href="${ctx}/advertiser/main/ad/target/ad-group-alloperator/list?orderId=${order.id!}&advertiserId=${advertiserId!}" class="tableTdStyle">${order.name!}</a>
                                </td>
                                <td class="tbodyTd">${order.budget!}</td>
                                <td class="tbodyTd">${order.ownerName!}</td>
                                <td class="tbodyTd"><a href="${ctx}/advertiser/main/ad/order/update?orderId=${order.id!}" class="tableTdStyle">${order.updated!?datetime}</a></td>
                                <td class="tbodyTd">
                                    <label class="switch">
                                        <input type="checkbox" <#if order.status==0>checked="checked"</#if>
                                        value="${order.id!}">
                                        <span></span>
                                    </label>
                                    <label class="switchText"><#if order.status==0>开启<#else>暂停</#if></label>
                                </td>
                                <td class="tbodyTd">
                                    <div id="listButtons">
                                        <a href="${ctx}/advertiser/main/ad/order/edit?orderId=${order.id!}&advertiserId=${advertiserId!}" class="btn3">编辑</a>
                                        <a href="${ctx}/advertiser/main/ad/report/advertiser-report/orderReport?jumpway=get&selectedadvertiserId=${advertiserId!}&selectedorderId=${order.id!}&selectedadvertiserName=${selectedadvertiserName!}&selectedorderName=${order.name!}" class="btn3">查看报表</a>
                                        <a id="btn-delete" value="${order.id!}" class="btn3 btn-delete">删除</a>
                                    </div>
                                </td>
                            </tr>
                        </#list>
                        </#if>
                    </tbody>
                </table>
                <div id="exportReport">
                    <a id="exportExcel" class="btn_export" href="javascript:void(0);" onclick="exportExcel_list()">导出Excel</a>
                </div>
                <div id="pageDiv">
                    <#include "/common/pagination/simple.ftl"/>
                </div>
            </form>
        </div>
    </div>
</div>
</@override>
<@extends name="/common/simple.ftl"/>